/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_ho_receipt_from_supplier_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionHoReceiptFromSupplierDetail.findAll", query = "SELECT p FROM PosTransactionHoReceiptFromSupplierDetail p"),
//    @NamedQuery(name = "PosTransactionHoReceiptFromSupplierDetail.findBySync", query = "SELECT p FROM PosTransactionHoReceiptFromSupplierDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionHoReceiptFromSupplierDetail.findByReceiptDetailId", query = "SELECT p FROM PosTransactionHoReceiptFromSupplierDetail p WHERE p.receiptDetailId = :receiptDetailId"),
//    @NamedQuery(name = "PosTransactionHoReceiptFromSupplierDetail.findByReceiptDetailQuantity", query = "SELECT p FROM PosTransactionHoReceiptFromSupplierDetail p WHERE p.receiptDetailQuantity = :receiptDetailQuantity"),
//    @NamedQuery(name = "PosTransactionHoReceiptFromSupplierDetail.findByReceiptDetailPrice", query = "SELECT p FROM PosTransactionHoReceiptFromSupplierDetail p WHERE p.receiptDetailPrice = :receiptDetailPrice")})
public class PosTransactionHoReceiptFromSupplierDetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "receipt_detail_id")
    private Integer receiptDetailId;
    @Column(name = "receipt_detail_quantity")
    private BigDecimal receiptDetailQuantity;
    @Column(name = "receipt_detail_price")
    private BigDecimal receiptDetailPrice;
    @Column(name = "receipt_detail_date_receipt")
    @Temporal(TemporalType.DATE)
    private Date receiptDetailDateReceipt;
    @Column(name = "receipt_detail_date_expired")
    @Temporal(TemporalType.DATE)
    private Date receiptDetailDateExpired;
    @Column(name = "receipt_detail_barcode")
    private String receiptDetailBarcode;
    @Lob
    @Column(name = "receipt_detail_description")
    private String receiptDetailDescription;
    @JoinColumn(name = "receipt_detail_receipt_id", referencedColumnName = "receipt_id")
    @ManyToOne
    private PosTransactionHoReceiptFromSupplier receiptDetailReceiptId;
    @JoinColumn(name = "receipt_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem receiptDetailItemId;

    public PosTransactionHoReceiptFromSupplierDetail() {
    }

    public PosTransactionHoReceiptFromSupplierDetail(Integer receiptDetailId) {
        this.receiptDetailId = receiptDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getReceiptDetailId() {
        return receiptDetailId;
    }

    public void setReceiptDetailId(Integer receiptDetailId) {
        this.receiptDetailId = receiptDetailId;
    }

    public BigDecimal getReceiptDetailQuantity() {
        return receiptDetailQuantity;
    }

    public void setReceiptDetailQuantity(BigDecimal receiptDetailQuantity) {
        this.receiptDetailQuantity = receiptDetailQuantity;
    }

    public BigDecimal getReceiptDetailPrice() {
        return receiptDetailPrice;
    }

    public void setReceiptDetailPrice(BigDecimal receiptDetailPrice) {
        this.receiptDetailPrice = receiptDetailPrice;
    }

    public PosMasterItem getReceiptDetailItemId() {
        return receiptDetailItemId;
    }

    public void setReceiptDetailItemId(PosMasterItem receiptDetailItemId) {
        this.receiptDetailItemId = receiptDetailItemId;
    }

    public String getReceiptDetailDescription() {
        return receiptDetailDescription;
    }

    public Date getReceiptDetailDateReceipt() {
        return receiptDetailDateReceipt;
    }

    public void setReceiptDetailDateReceipt(Date receiptDetailDateReceipt) {
        this.receiptDetailDateReceipt = receiptDetailDateReceipt;
    }

    public String getReceiptDetailBarcode() {
        return receiptDetailBarcode;
    }

    public void setReceiptDetailBarcode(String receiptDetailBarcode) {
        this.receiptDetailBarcode = receiptDetailBarcode;
    }

    public Date getReceiptDetailDateExpired() {
        return receiptDetailDateExpired;
    }

    public void setReceiptDetailDateExpired(Date receiptDetailDateExpired) {
        this.receiptDetailDateExpired = receiptDetailDateExpired;
    }

    public void setReceiptDetailDescription(String receiptDetailDescription) {
        this.receiptDetailDescription = receiptDetailDescription;
    }

    public PosTransactionHoReceiptFromSupplier getReceiptDetailReceiptId() {
        return receiptDetailReceiptId;
    }

    public void setReceiptDetailReceiptId(PosTransactionHoReceiptFromSupplier receiptDetailReceiptId) {
        this.receiptDetailReceiptId = receiptDetailReceiptId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (receiptDetailId != null ? receiptDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionHoReceiptFromSupplierDetail)) {
            return false;
        }
        PosTransactionHoReceiptFromSupplierDetail other = (PosTransactionHoReceiptFromSupplierDetail) object;
        if ((this.receiptDetailId == null && other.receiptDetailId != null) || (this.receiptDetailId != null && !this.receiptDetailId.equals(other.receiptDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosTransactionHoReceiptFromSupplierDetail[ receiptDetailId=" + receiptDetailId + " ]";
    }
}
